package com.chlitina.store.modules.message.utils;

import com.chlitina.store.modules.base.entity.Customer;
import com.chlitina.store.modules.cash.entity.StoreReserve;
import com.chlitina.store.modules.message.entity.StoreEmployeeTask;

public class MessageUtils {
	
	public static StoreEmployeeTask transformReserveToEmployeeTask(StoreReserve storeReserve){
		StoreEmployeeTask employeeTask = new StoreEmployeeTask();
		if (storeReserve != null) {
			employeeTask.setStoreReserve(storeReserve);
			employeeTask.setStore(storeReserve.getStore());
			employeeTask.setEmployee(storeReserve.getEmployee());
			employeeTask.setTaskDate(storeReserve.getReserveTime());
			employeeTask.setType(StoreEmployeeTask.TYPE_STORE_RESEVER);
			Customer member = storeReserve.getMember();
			if (member != null) {
				employeeTask.setCustomer(storeReserve.getMember());
				employeeTask.setTaskContent(storeReserve.getReason());
			} else {
				employeeTask.setTaskContent(storeReserve.getReason());
			}
		}
		return employeeTask;
	}
}
